@REM @file
@REM
@REM @copyright
@REM  INTEL CONFIDENTIAL
@REM  Copyright 2014 - 2018 Intel Corporation.
@REM
@REM  The source code contained or described herein and all documents related to the
@REM  source code ("Material") are owned by Intel Corporation or its suppliers or
@REM  licensors. Title to the Material remains with Intel Corporation or its suppliers
@REM  and licensors. The Material may contain trade secrets and proprietary and
@REM  confidential information of Intel Corporation and its suppliers and licensors,
@REM  and is protected by worldwide copyright and trade secret laws and treaty
@REM  provisions. No part of the Material may be used, copied, reproduced, modified,
@REM  published, uploaded, posted, transmitted, distributed, or disclosed in any way
@REM  without Intel's prior express written permission.
@REM
@REM  No license under any patent, copyright, trade secret or other intellectual
@REM  property right is granted to or conferred upon you by disclosure or delivery
@REM  of the Materials, either expressly, by implication, inducement, estoppel or
@REM  otherwise. Any license under such intellectual property rights must be
@REM  express and approved by Intel in writing.
@REM
@REM  Unless otherwise agreed by Intel in writing, you may not remove or alter
@REM  this notice or any other notice embedded in Materials by Intel or
@REM  Intel's suppliers or licensors in any way.
@REM
@REM  This file contains a 'Sample Driver' and is licensed as such under the terms
@REM  of your license agreement with Intel or your vendor. This file may be modified
@REM  by the user, subject to the additional terms of the license agreement.
@REM
@REM @par Specification Reference:
@REM

@echo off
echo.
echo Run build cleanall...
echo.

cd ..

if not defined WORKSPACE set WORKSPACE=%cd%
if not defined WORKSPACE_PLATFORM set WORKSPACE_PLATFORM=%cd%
if not defined WORKSPACE_SILICON set WORKSPACE_SILICON=%cd%

REM build cleanall

echo.
echo Directories to clean...
echo.

if exist %WORKSPACE%\build rmdir /q /s %WORKSPACE%\build
if exist %WORKSPACE%\conf\.cache rmdir /q /s %WORKSPACE%\conf\.cache
if exist %WORKSPACE%\RomImages rmdir /q /s %WORKSPACE%\RomImages
@REM
@REM RPPO-KBL-0093: RoyalParkOverrideBegin
@REM
if exist %WORKSPACE%\BaseToolsTmp rmdir /q /s %WORKSPACE%\BaseToolsTmp  
@REM
@REM RPPO-KBL-0093: RoyalParkOverrideEnd
@REM


echo.
echo Files to clean...
echo.

if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log
if exist %WORKSPACE%\Conf\build_rule.txt del %WORKSPACE%\Conf\build_rule.txt
if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSPACE%\Conf\FrameworkDatabase.db
if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target.txt
if exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_def.txt
if exist %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg\CapsuleUpdateConfig\BIOSUPDATE.Fv del %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg\CapsuleUpdateConfig\BIOSUPDATE.Fv
if exist %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg\CapsuleUpdateConfig\Capsule_Reset.cap del %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg\CapsuleUpdateConfig\Capsule_Reset.cap
if exist %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg\CapsuleUpdateConfig\CapsuleApp.efi del %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg\CapsuleUpdateConfig\CapsuleApp.efi
@REM *.c.c is generated by Catalog Debug feature across code tree.
@REM
del /s *.c.c > nul 2>&1

cd %WORKSPACE_PLATFORM%\KabylakePlatSamplePkg

del /f /q Tools\RomImage\KabylakeH\fit.log > nul 2>&1
del /f /q Tools\RomImage\KabylakeH_SV_FW\fit.log > nul 2>&1
del /f /q Tools\RomImage\KabylakeLP\fit.log > nul 2>&1
del /f /q Tools\RomImage\KabylakeLP_SV_FW\fit.log > nul 2>&1
del /f /q Prep.log > nul 2>&1
del /f /q ..\Build.log > nul 2>&1
del /f /q ..\AslAnalyze*.log > nul 2>&1

echo.
echo All done...
echo.
@echo on
